{include file="public/head"}

<body>
	
</body>
{include file="public/foot"}

<script type="text/javascript">
	//爬虫
	var urls = 'https://chart.cp.360.cn/zst/ssq?r_a=UZFZnq';
	crawler(urls);
	function crawler(urls){
		$.ajax({
			type: "post",
			url: "/admin/Double/crawlerQuery",
			async: true,
			data: {
				urls: urls,
			},
			dataType: "json",
			success: function(res) {
				console.log(res[0]);
				$("body").html(res[0]);
				getData();
			}
		});
	}
	function getData(){
		$.each($('.zzhfb tr'), function(index, value) {
			//		console.log(value)
			var period, rednum, bluenum;
			$.each($(value).find('.tdbg_1'), function(ind, val) {
				if(val.className.indexOf('thide') >= 0) {
					rednum = $(val).find('.rednum').html();
					bluenum = $(val).find('.bluenum').html();
//									console.log(val)
					//				console.log(rednum)
					//				console.log(bluenum)
				} else {
					period = $(val).html();
					//				console.log(period)
				}
				//			console.log('')
			});
//			console.log('period',period)
//			console.log('rednum',rednum)
//			console.log('bluenum',bluenum)
			inData(period, rednum, bluenum);
		});
	}
	
	function inData(period, rednum, bluenum) {
		$.ajax({
			type: "post",
			url: "/admin/Double/inData",
			async: true,
			data: {
				period: period,
				rednum: rednum,
				bluenum: bluenum,
			},
			dataType: "json",
			success: function(res) {
				console.log(res)
			}
		});
	}
</script>